using UnityEngine;
using System.Collections;

public class Popup : MonoBehaviour {
	
	private Rect popupWindow;
	public bool popupInfoVisible;
	public string popupContent;
	public Spells mySpell;
	
	public void DisplayPopupInfo(bool b, Spells spell=null)
	{
		if ( b)
		{
			popupInfoVisible = true;
			popupContent = "this is an info popup";
			mySpell = spell;
		}
		else
		{
			popupInfoVisible = false;
			popupContent = "";
		}
	}
	
	public void PopupInfo()
    {
		popupWindow = new Rect(320, (Screen.height * 0.75f), 300, (Screen.height * 0.25f));
        popupWindow = GUILayout.Window(0, popupWindow, PopupInfoContent, "Infos du sort");
    }

	public void PopupInfoContent(int windowD)
    {
        GUILayout.Label(mySpell.ToString());
    }
	
	 public void OnGUI()
    {
        if ( popupInfoVisible )
		{
			PopupInfo();
		}
    }
}
